#ifndef _STRUCT_H
#define _STRUCT_H

#include "o_stdafx.h"

/********************************
 Common object
 ********************************/

#if defined _WIN32

struct Vertex_XYZRHW {
    float x;
    float y;
    float z;
    float rhw;
    DWORD color;
    float u;
    float v;
};

#define VERTEX_FVF_XYZRHW (D3DFVF_XYZRHW|D3DFVF_DIFFUSE|D3DFVF_TEX1)

struct Geometric_Object_2D {

    LPDIRECT3DVERTEXBUFFER9 p_vb;
    LPDIRECT3DINDEXBUFFER9  p_ib;

    int     i_vertex;
    int     i_index;
    int     i_stride;

    DWORD   fvf;
    DWORD   prim_type;
};
 
struct Texture_Object{

    LPDIRECT3DTEXTURE9 p_texture;
};

/*******************************
 *  App config data structure
 *******************************/

struct Core_Config {

    HINSTANCE       h_instance;
    HWND            h_wnd;
    WINDOWPLACEMENT w_p;

	DWORD           dw_style;

    int             i_window_w;
    int             i_window_h;
    int             i_fullscreen_w;
    int             i_fullscreen_h;

    bool            b_fullscreen;
};

struct Graphic_Config {

    LPDIRECT3D9             p_object;
    LPDIRECT3DDEVICE9       p_device;
    D3DCAPS9                caps;
    D3DPRESENT_PARAMETERS   pp;
    D3DDISPLAYMODE          display_mode;
    D3DFILLMODE             fill_mode;

    DWORD                   dw_clear_color;
    DWORD                   dw_clear_buffer;

    Graphic_Config()
    {
        dw_clear_color  = D3DCOLOR_XRGB(50,150,50);
        dw_clear_buffer = D3DCLEAR_TARGET;
    }
};

struct MapSys_Config {
    unsigned int ui_cur_map;
    unsigned int ui_tot_map;

    MapSys_Config():ui_cur_map(0),ui_tot_map(0)
    {}
};

struct Map_Config {
    DWORD cell_fvf;
    DWORD cell_w;
    DWORD cell_h;
    DWORD map_size_x;
    DWORD map_size_y;
};

#elif defined _MAC

#endif

#endif
